//#include "StudentLinkedList.h"
//#define INDEX_INIT_VAL 0
//#define FIRST_NODE 1
//// TODO must be defined in Start.h!!!!!!
//#define ID_ERROR_VAL -1
//#define NAME_ERROR_VAL "ERROR"
//
//// TODO DEBUG!!!
//#include <iostream>
//using namespace std;
//
//// class Node's methods
//StudentLinkedList::Node::Node(Student* const studentToPoint) :
//		m_studentData(studentToPoint) {
//
//	// TODO DEBUG PRINT!!!
//	cout << "in node constructor" << endl;
//
//	// new node is not yet linked to the list
//	m_prevNode = NULL;
//	m_nextNode = NULL;
//	m_index = INDEX_INIT_VAL;
//}
//
//StudentLinkedList::Node::~Node() {
//
//	// TODO DEBUG PRINT!!!
//	cout << "in node destructor" << endl;
//
//	delete m_studentData; // delete allocated memory for pointed student
//}
//
//// class StudentLinkedList methods
//StudentLinkedList::StudentLinkedList() {
//
//	// TODO DEBUG PRINT!!!
//	cout << "in student list constructor" << endl;
//
//	// list is empty at initialization, pointers point at NULL
//	m_head = NULL;
//	m_tail = NULL;
//	m_currentNode = NULL;
//}
//
//StudentLinkedList::~StudentLinkedList() {
//
//	// TODO DEBUG PRINT!!!
//	cout << "in student list destructor" << endl;
//
//	// if list is not empty scan it and delete node by node, otherwise do nothing
//	if (m_head != NULL) {
//
//		Node* currNode = m_head->m_nextNode;
//		Node* prevNode = m_head;
//
//		while (currNode != NULL) { // not reached yet last node
//			// move to next node on list and delete the previous which has been scanned
//			delete prevNode;
//			prevNode = currNode;
//			currNode = currNode->m_nextNode;
//		}
//		delete prevNode; // delete last node on list
//	} // if (m_head != NULL)
//}
//
//void StudentLinkedList::setNodeIndex(Node* const nodeToUpdt, const int newIndex) {
//	nodeToUpdt->m_index = newIndex;
//}
//
////void StudentLinkedList::addStudent(const Student* newStudent) {
////
////	Node* newNode = new Node(newStudent); // create a node pointing to given student
////
////	if (m_head == NULL) { // list is empty
////
////		m_head->m_nextNode = newNode;
////		m_tail->m_prevNode = newNode;
////		newNode->m_index = FIRST_NODE;
////
////	} else { // list is not empty
////
////		Node* currNode = m_head->m_nextNode; // point to first node
////		while (currNode != m_tail->m_prevNode) { // scan list to its end
////
////			if ( currNode->m_studentData->getStudentID() < newNode->m_studentData->getStudentID() ) { // link new node according to ID sort
////				// link new node to its next node
////				newNode->m_nextNode = currNode->m_nextNode;
////				currNode->m_nextNode->m_prevNode = newNode;
////				// link new node to its previous node
////				newNode->m_prevNode = currNode;
////				currNode->m_nextNode = newNode;
////				// update new node's index and increment index of the rest of list's nodes
////				while (currNode != m_tail->m_prevNode) {
////					setNodeIndex(currNode, currNode->m_index);
////					currNode = currNode->m_nextNode;
////				}
////			} // if ( currNode->m_studentData->getStudentID() < newNode->m_studentData->getStudentID() )
////
////		} // while (currNode != m_tail->m_prevNode)
////
////
////	}
////
////}
//
//void StudentLinkedList::addStudent(Student* const newStudent) {
//
//	// TODO DEBUG PRINT!!!
//	cout << "adding student" << endl;
//
//	// list is empty
//	if (m_head == NULL) {
//		Node* newNode = new Node(newStudent); // create a node pointing to given student
//		m_head = newNode;
//		m_tail = newNode;
//
//		// TODO DEBUG!!!
//		m_currentNode = m_head; // set the first node as default value to current node
//
//		newNode->m_index = FIRST_NODE; // set new node's index
//
//		// TODO DEBUG PRINT!!!
//		cout << "head's index: " << m_head->m_index << " tail's index: " << m_tail->m_index << endl;
//		cout << "done adding student" << endl;
//
//		return;
//	}
//	// link as last node
//	if (m_tail->m_studentData->getStudentID()
//			< newStudent->getStudentID()) {
//			// link new node after last node
//		Node* newNode = new Node(newStudent); // create a node pointing to given student
//		newNode->m_prevNode = m_tail;
//		m_tail->m_nextNode = newNode;
//		newNode->m_index = m_tail->m_index + 1; // set new node's index
//		m_tail = newNode; // update list's tail
//
//		// TODO DEBUG PRINT!!!
//		cout << "head's index: " << m_head->m_index << " tail's index: " << m_tail->m_index << endl;
//		cout << "done adding student" << endl;
//
//		return;
//	}
//	// link as first node
//	if (newStudent->getStudentID()
//			< m_head->m_studentData->getStudentID()) {
//			// link new node before first node
//		Node* newNode = new Node(newStudent); // create a node pointing to given student
//		newNode->m_nextNode = m_head;
//		m_head->m_prevNode = newNode;
//		m_head = newNode; // update list's head
//		// update new node's index and increment index of the rest of list's nodes
//		newNode->m_index = FIRST_NODE;
//		Node* currNode = m_head->m_nextNode;
//		while (currNode != NULL) {
//			setNodeIndex(currNode, currNode->m_index+1);
//			currNode = currNode->m_nextNode;
//		}
//
//		// TODO DEBUG PRINT!!!
//		cout << "head's index: " << m_head->m_index << " tail's index: " << m_tail->m_index << endl;
//		cout << "done adding student" << endl;
//
//		return;
//	}
//	// scan list and find where to link the new node
//	Node* currNode = m_head->m_nextNode;
//	while (currNode != NULL) {
//
//		if (currNode->m_studentData->getStudentID()
//				<= newStudent->getStudentID()) { // link new node according to ID sort
//
//				// link new node to its next node
//			if (currNode->m_studentData->getStudentID()
//				== newStudent->getStudentID()) { // student with given ID already exists, return ERROR
//				return false;
//			}
//			//
//			Node* newNode = new Node(newStudent); // create a node pointing to given student
//			newNode->m_nextNode = currNode->m_nextNode;
//			currNode->m_nextNode->m_prevNode = newNode;
//			// link new node to its previous node
//			newNode->m_prevNode = currNode;
//			currNode->m_nextNode = newNode;
//			// update new node's index and increment index of the rest of list's nodes
//			while (currNode != NULL) {
//				setNodeIndex(currNode, currNode->m_index);
//				currNode = currNode->m_nextNode;
//			}
//			break; // position found, stop scanning
//
//		} // if ( currNode->m_studentData->getStudentID() < newNode->m_studentData->getStudentID() )
//
//	} // while (currNode != m_tail->m_prevNode)
//
//	// TODO DEBUG PRINT!!!
//	cout << "head's index: " << m_head->m_index << " tail's index: " << m_tail->m_index << endl;
//	cout << "done adding student" << endl;
//}
//
//Student* StudentLinkedList::searchByKey(const int key) {
//
//	// scan list and find the student matching given key
//	Node* currNode = m_head;
//	while (currNode != NULL) {
//		if (currNode->m_studentData->getStudentID() == key) {
//			return currNode->m_studentData;
//		}
//		currNode = currNode->m_nextNode; // move to next node
//	}
//	return NULL; // no match found
//}
//
//Student* StudentLinkedList::searchByIndex(const int index) {
//
//	// scan list and find the student whose node matching given index
//	Node* currNode = m_head;
//	while (currNode != NULL) {
//		if (currNode->m_index == index) {
//			return currNode->m_studentData;
//		}
//		currNode = currNode->m_nextNode; // move to next node
//	}
//	return NULL; // no match found
//}
//
//// TODO DEBUG!!!
//void StudentLinkedList::printList() const {
//
//	// scan list and print each student's attributes
//	Node* currNode = m_head;
//	cout << "Students:[";
//	while (currNode != NULL) {
//		cout << "Student:[ID:" << currNode->m_studentData->getStudentID() << ", name:" << currNode->m_studentData->getStudentName() << "]";
//		currNode = currNode->m_nextNode;
//		if (currNode != NULL) {
//			cout << ", ";
//		}
//	}
//	cout << "]" << endl;
//}
//
//bool StudentLinkedList::initCurrent() {
//
//	m_currentNode = m_head; // current node is now list's head
//	// if list is empty (head points at NULL) return FALSE
//	if (m_head == NULL) {
//		return false;
//	}
//	// else return TRUE
//	return true;
//}
//
//bool StudentLinkedList::incrmntCurrent() {
//	// list is empty, no node to increment to
//	if (m_currentNode == NULL) {
//		return false;
//	}
//
//	m_currentNode = m_currentNode->m_nextNode; // increment current node pointer to next node on list
//
//	// if next node is NULL, reached on of list and return FALSE
//	if (m_currentNode == NULL) {
//		return false;
//	}
//
//	// has not reached end yet, return TRUE
//	return true;
//}
//
//int StudentLinkedList::getCurrentID() const {
//	// list is empty or reached end of list
//	if (m_currentNode == NULL) {
//		return ID_ERROR_VAL;
//	}
//	return m_currentNode->m_studentData->getStudentID(); // return current Student's id
//}
//
//string StudentLinkedList::getCurrentName() const {
//	// list is empty or reached end of list
//	if (m_currentNode == NULL) {
//		return NAME_ERROR_VAL;
//	}
//	return m_currentNode->m_studentData->getStudentName(); // return current Student's name
//}
